home *** CD-ROM | disk | FTP | other *** search
- /**********************************
- * pathname subroutine - Adapted from MPW toolkit C examples
- *
- * subroutine description
- *
- * argument description
- *
- ***********************************/
-
- /********************
- * Standard C includes
- *********************/
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
-
- /***************************
- * Macintosh toolbox includes
- ****************************/
- #include <Packages.h>
-
- void pathname (char *filenam,int vRefNum,long dirID)
- {
- DirInfo di;
- char dname[32];
- Boolean flag = 0;
-
- di.ioNamePtr = (StringPtr) &dname;
- di.ioVRefNum = vRefNum;
- di.ioFDirIndex = -1;
- di.ioDrDirID = dirID;
-
- if (PBGetCatInfo((CInfoPBPtr) &di,flag))
- return;
-
- if (dirID != 2) {
- pathname(filenam,vRefNum,di.ioDrParID);
- if (filenam == NULL)
- return;
- }
-
- strcat(filenam,p2cstr((StringPtr) dname));
- strcat(filenam,":");
- }